package org.firebug.spring.boot.mybatis.plus.repository.entity;

import java.io.Serializable;
import lombok.Data;
import lombok.experimental.Accessors;
import com.baomidou.mybatisplus.annotation.*;
import java.math.BigDecimal;
import java.util.Date;
import java.time.LocalDate;
import org.firebug.spring.boot.mybatis.plus.enums.Gender;

/**
 * 用户表
 * @author: 张晓东
 * @date: 2020-04-27
 */
@Data
@Accessors(chain = true)
@TableName("t_user")
public class UserEntity implements Serializable {
    private static final long serialVersionUID = 675036151760335691L;
    
    /**
     * ID
     */
	@TableId(value = "id", type = IdType.AUTO)
    private Long id;
    /**
     * 姓名
     */
    @TableField(value = "name", insertStrategy = FieldStrategy.NOT_NULL, updateStrategy = FieldStrategy.NOT_NULL)
    private String name;
    /**
     * 薪水
     */
    @TableField(value = "salary", insertStrategy = FieldStrategy.NOT_NULL, updateStrategy = FieldStrategy.NOT_NULL)
    private BigDecimal salary;
    /**
     * 生日
     */
    @TableField(value = "birthday", insertStrategy = FieldStrategy.NOT_NULL, updateStrategy = FieldStrategy.NOT_NULL)
    private LocalDate birthday;
    /**
     * 性别
     */
    @TableField(value = "gender", insertStrategy = FieldStrategy.NOT_NULL, updateStrategy = FieldStrategy.NOT_NULL)
    private Gender gender;
    /**
     * 用户状态(业务逻辑里是枚举)
     */
    @TableField(value = "status", insertStrategy = FieldStrategy.NOT_NULL, updateStrategy = FieldStrategy.NOT_NULL)
    private Integer status;
    /**
     * 逻辑删除
     */
    @TableLogic(value = "0", delval = "1")
    @TableField(value = "deleted", insertStrategy = FieldStrategy.NEVER, updateStrategy = FieldStrategy.NEVER, select = false)
    private boolean deleted;
    /**
     * 乐观锁
     */
    @Version
    @TableField(value = "version", insertStrategy = FieldStrategy.NEVER, updateStrategy = FieldStrategy.DEFAULT)
    private Integer version;
    /**
     * 创建人
     */
    @TableField(value = "creater", insertStrategy = FieldStrategy.NOT_NULL, updateStrategy = FieldStrategy.NEVER)
    private Long creater;
    /**
     * 创建时间
     */
    @TableField(value = "create_time", insertStrategy = FieldStrategy.NEVER, updateStrategy = FieldStrategy.NEVER)
    private Date createTime;
    /**
     * 修改人
     */
    @TableField(value = "modifier", insertStrategy = FieldStrategy.NEVER, updateStrategy = FieldStrategy.NOT_NULL)
    private Long modifier;
    /**
     * 修改时间
     */
    @TableField(value = "modify_time", insertStrategy = FieldStrategy.NEVER, updateStrategy = FieldStrategy.NEVER)
    private Date modifyTime;
}